<template>
  <div class="swiper">
    <swipe :autoplay="3000" height="195" indicator-color="#D43322">
      <swipe-item v-for="(item, index) in banner" :key="index" @click="handleClick(item.link)">
        <img v-lazy="item.image" />
      </swipe-item>
    </swipe>
  </div>
</template>

<script>
import { Swipe, SwipeItem } from "vant";
export default {
  name: "swiperHome",
  props: {
    banner: { type: Array }
  },
  components: {
    Swipe,
    SwipeItem
  },
  data() {
    return {};
  },

  methods: {
    handleClick(url){
      window.location.href=url
    }
  }
};
</script>

<style scoped lang="scss">
  img{
    width: 100%;
    height: 195px;
  }
  ::v-deep .van-swipe__indicator{
    width: 8px;
    height: 8px;
    background-color: #fff;
    opacity: 1;
  }
</style>
